<template>
  <view class="content flex-col-center">
    <button type="default" @click="handleChooseImage">选择图片上传</button>
  </view>
</template>

<script setup>
import { chooseOneImage } from '@/utils/upload'
import { setAvatar } from '@/apis/user'
const handleChooseImage = async () => {
  let res = await chooseOneImage()
  if (res.errMsg !== 'chooseImage:ok') {
    return
  }
  console.log(res)
  res = await setAvatar(res.tempFilePaths[0])
  console.log(res)
}
</script>

<style lang="scss">
.content {
  height: 100%;
}
</style>
